package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the SUPPLIES_TYPE database table.
 * 
 */
@Entity
@Table(name="SUPPLIES_TYPE")
@NamedQuery(name="SuppliesType.findAll", query="SELECT s FROM SuppliesType s")
public class SuppliesType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="STYPE_ID")
	private long stypeId;

	@Column(name="STYPE_NAME")
	private String stypeName;

	//bi-directional many-to-one association to Supply
	@OneToMany(mappedBy="suppliesType")
	private List<Supply> supplies;

	public SuppliesType() {
	}

	public long getStypeId() {
		return this.stypeId;
	}

	public void setStypeId(long stypeId) {
		this.stypeId = stypeId;
	}

	public String getStypeName() {
		return this.stypeName;
	}

	public void setStypeName(String stypeName) {
		this.stypeName = stypeName;
	}

	public List<Supply> getSupplies() {
		return this.supplies;
	}

	public void setSupplies(List<Supply> supplies) {
		this.supplies = supplies;
	}

	public Supply addSupply(Supply supply) {
		getSupplies().add(supply);
		supply.setSuppliesType(this);

		return supply;
	}

	public Supply removeSupply(Supply supply) {
		getSupplies().remove(supply);
		supply.setSuppliesType(null);

		return supply;
	}

}